#@TYPE: Configuration
#@NAME: PE2201
#@DESCRIPTION: Common machine configuration for the PE2201

PREFERRED_PROVIDER_virtual/kernel ?= "linux-phytium"
PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot-phytium-sdk"
PREFERRED_PROVIDER_u-boot ?= "u-boot-phytium-sdk"
PREFERRED_PROVIDER_u-boot-fw-utils ?= "u-boot-fw-utils-phytium-sdk"

KERNEL_IMAGETYPE ?= "fitImage"
KERNEL_CLASSES ?= "kernel-fitimage"
INITRAMFS_IMAGE ?= "obmc-phosphor-initramfs"
INITRAMFS_FSTYPES ?= "cpio.xz"

SOC_FAMILY = "phytium"
include conf/machine/include/soc-family.inc

MACHINE_EXTRA_RRECOMMENDS += "udev-mtd-partitions"

MACHINEOVERRIDES =. "pe2201:"

DEFAULTTUNE ?= "armv8a"
require conf/machine/include/arm/arch-armv8a.inc

# Add some kinds of filesystem according to development requirements.
IMAGE_FSTYPES += "\
    squashfs-xz \
    mtd-static \
    mtd-static-tar \
    mtd-static-alltar \
    "

# The offsets of different components in one 64MB flash chip.
FLASH_SIZE ?= "65536"
FLASH_UBOOT_OFFSET ?= "0"
FLASH_KERNEL_OFFSET:flash-65536 ?= "3072"
FLASH_ROFS_OFFSET:flash-65536 ?= "16384"
FLASH_RWFS_OFFSET:flash-65536 ?= "57344"

UBOOT_ENTRYPOINT ?= "0x80080000"
UBOOT_LOADADDRESS ?= "0x80080000"
UBOOT_DTB_LOADADDRESS ?= "0x82000000"

TARGET_FPU = "${@bb.utils.contains('TUNE_FEATURES', [ 'aarch64', 'armv8a' ], 'hard', 'soft', d)}"
